﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WcfContrib.Extensions.Caching
{
    /// <summary>
    /// Represents an implementation for a store for output caching
    /// </summary>
    public interface IOutputCacheStore
    {
        /// <summary>
        /// Adds or replaces the item in the store.
        /// </summary>
        /// <param name="key">The item key.</param>
        /// <param name="value">The value.</param>
        void SetItem(OutputCacheItemKey key, object value);

        /// <summary>
        /// Removes the item from the store.
        /// </summary>
        /// <param name="key">The item key.</param>
        void RemoveItem(OutputCacheItemKey key);

        /// <summary>
        /// Tries to get the item from the store.
        /// </summary>
        /// <param name="key">The item key.</param>
        /// <param name="value">The value.</param>
        /// <returns>true if the item was found; otherwise, false</returns>
        bool TryGetItem(OutputCacheItemKey key, out object value);
    }
}
